{% macro my_paginate(pagination,url) %}
    <div class="mt-10 mb-10 ml-10 mr-10">
        页数：{{ pagination.page }}/{{ pagination.pages }}&nbsp;
        共{{ pagination.total }}条数据
        <span class="f-r">
            {% if pagination.has_prev %}
                <a class="c-blue active" href="{{ url }}?page=1">首页</a>
                <a class="c-blue active" href="{{ url }}?page={{ pagination.prev_num }}">上页</a>
            {% else %}
                <span class="c-999 disabled">首页</span>
                <span class="c-999 disabled">上页</span>
            {% endif %}

            {% for page in pagination.iter_pages(1,1,3,1) %}  {# <!-- left_edge左边,left_current左当前,right_currrent右侧当前,right_edge右边  --> #}
                {% if page %}
                    {% if page != pagination.page %}
                    <a class="c-999 disabled" href="{{ url }}?page={{ page }}">{{ page }}</a>
                    {# <a class="c-blue {% if page==pagination.page %}active{% endif %}" href="{{ url }}?page={{ page }}">{{ page }}</a> #}
                    {% else %}
                    <strong>{{ page }}</strong>
                    {% endif %}
                {% else %}
                    <span class="c-999 disabled">...</span>
                {% endif %}
            {% endfor %}

            {% if pagination.has_next %}
                <a class="c-blue active" href="{{ url }}?page={{ pagination.next_num }}">下页</a>
                <a class="c-blue active" href="{{ url }}?page={{ pagination.pages }}">末页</a>
            {% else %}
                <span class="c-999 disabled">下页</span>
                <span class="c-999 disabled">末页</span>
            {% endif %}
        </span>
    </div>
{% endmacro %}

{% macro code_paginate(pagination,url) %}
    <div class="mt-10 mb-10 ml-10 mr-10">
        页数：{{ pagination.page }}/{{ pagination.pages }}&nbsp;
        共{{ pagination.total }}条数据
        <span class="f-r">
            {% if pagination.has_prev %}
                <a class="c-blue active" href="{{ url }}?page=1">首页</a>
                <a class="c-blue active" href="{{ url }}?page={{ pagination.prev_num }}">上页</a>
            {% else %}
                <a class="c-999 disabled" href="#">首页</a>
                <a class="c-999 disabled" href="#">上页</a>
            {% endif %}

            {% for page in pagination.iter_pages(1,1,3,1) %}
                {% if page %}
                    <a class="c-blue {% if page==pagination.page %}active{% endif %}" href="{{ url }}?page={{ page }}">{{ page }}</a>
                {% else %}
                    <a class="c-999 disabled" href="#">...</a>
                {% endif %}
            {% endfor %}

            {% if pagination.has_next %}
                <a class="c-blue active" href="{{ url }}?page={{ pagination.next_num }}">下页</a>
                <a class="c-blue active" href="{{ url }}?page={{ pagination.pages }}">末页</a>
            {% else %}
                <a class="c-999 disabled" href="#">下页</a>
            <a class="c-999 disabled" href="#">末页</a>
            {% endif %}
        </span>
    </div>
{% endmacro %}